package com.dkd.model.cusServiceCall.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dkd.model.base.utils.PageUtil;
import com.dkd.model.cusServiceCall.entity.CusServiceCall;
import com.dkd.model.cusServiceCall.mapper.CusServiceCallMapper;
import com.dkd.model.cusServiceCall.service.CusServiceCallService;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Bean
 * @since 2018-09-04
 */
@Service
public class CusServiceCallServiceImpl extends ServiceImpl<CusServiceCallMapper, CusServiceCall> implements CusServiceCallService {

    @Override
    public List<CusServiceCall> selectListBySQL(){
        return baseMapper.selectListBySQL();
    }

    @Override
    public List<CusServiceCall> selectByPrimaryId(Long id) {
        return baseMapper.selectByPrimaryId(id);
    }

    @Override
    public PageUtil<CusServiceCall> selectListPageByMap(int current, int size, String status){
        PageHelper.startPage(current, size);
        List<CusServiceCall> list = baseMapper.selectListPageByStatus(status);
        Long count = baseMapper.selectListPageByStatusCount(status);
        PageUtil<CusServiceCall> pageData = new PageUtil<CusServiceCall>(current, size, count);
        pageData.setRecords(list);
        return pageData;
    }
}
